package com.ruoyi.web.controller.wlsggk;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.waterdrop.wlsggk.pojo.MaterialInventory;
import com.waterdrop.wlsggk.pojo.MaterialRemainingLog;
import com.waterdrop.wlsggk.pojo.MaterialReplenishmentLog;
import com.waterdrop.wlsggk.service.IMaterialInventoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/wlsggk/materialInventory")
public class MaterialInventoryController extends BaseController {

    @Autowired
    private IMaterialInventoryService materialInventoryService;

    /**
     * 获取库存列表
     */
    @GetMapping("/list")
    public TableDataInfo list(MaterialInventory materialInventory) {
        startPage();
        List<MaterialInventory> list = materialInventoryService.selectMaterialInventoryList(materialInventory);
        return getDataTable(list);
    }

    /**
     * 初始化库存信息
     */
/*    @PostMapping
    public AjaxResult add(@Validated @RequestBody WlsggkMaterialInventory wlsggkMaterialInventory) {
        return toAjax(wlsggkMaterialInventoryService.insertWlsggkMaterialInventory(wlsggkMaterialInventory));
    }*/

    /**
     * 修改库存信息
     */
    @PutMapping
    public AjaxResult edit(@Validated @RequestBody List<MaterialInventory> materialInventory) {
//        return toAjax(materialInventoryService.updateWlsggkMaterialInventory(materialInventory));
        return null;
    }

    /**
     * 新增剩余信息
     */
    @PutMapping("/Remainning")
    public AjaxResult insertRemainning(@Validated @RequestBody List<MaterialRemainingLog> materialRemainingLog) {
//        return toAjax(materialInventoryService.insertRemainning(materialRemainingLog));
        return null;
    }

    /**
     * 新增补货信息
     */
    @PutMapping("/Replenishment")
    public AjaxResult insertReplenishment(@Validated @RequestBody List<MaterialReplenishmentLog> materialReplenishmentLog) {
//        return toAjax(materialInventoryService.insertReplenishment(materialReplenishmentLog));
        return null;
    }

}
